TWiki . EBR . CoreSoftwareGateway |
This section covers the installation of the example EbrGateway supplied with the CoreSoftware.
Follow the steps below to install the CoreSoftware EbrGateway.
- NOTE: If you have already correctly installed Java to install the CoreSoftware EbrNode, you can skip this step)
The CoreSoftware is written in Java and requires a Sun Java Runtime Edition >= than v1.4.0 to be installed on the target machine.
This software and platform specific installation notes can be downloaded from Sun Java Site (http://java.sun.com/) or found within the Java Runtimes folder on the AdminSite.
Ensure that Java is correctly installed on the target system. It is recommended that the directory containing the java executable is added to the appropriate "path" environment variable.
- NOTE: If it is already installed, you can skip this step.
Decide on where you are going to store the EBR Software on your system. In the following examples we are storing the software in a directory named /usr/local/ebr. You can alter this to suit your own system policy. Download EBRSoftware.zip from the SNAS and place it in your chosen directory. Unzip the contents into that directory. You should see a layout such as:
rio:/usr/local/ebr# ls -l total 544 drwxrwxr-x 3 root staff 4096 Nov 1 14:07 classes -rw-r--r-- 1 root staff 539744 Nov 1 14:07 EBRSoftware.zip drwxrwxr-x 3 root staff 4096 Nov 1 14:01 g2 drwxrwxr-x 2 root staff 4096 Sep 3 14:12 lib
-
NOTE: Replace references to ebrnode
with
ebrgw
.
Decide which user on the system is going to run the EbrNode. It is
recommended that a special new ebrnode
user is created.
Login as the new user and set the new users system CLASSPATH
to
reflect where the EBR software was installed.
For example, for the installation above, the following CLASSPATH
should be set ( for the GammaPhase CoreSoftware
release)
$ export CLASSPATH=/usr/local/ebr/classes:/usr/local/ebr/lib/mail.jar:/usr/local/ebr/lib/activation.jar:/usr/local/ebr/lib/jdom.jar: /usr/local/ebr/lib/jox116.jar:/usr/local/ebr/lib/orctel-io-v0_0_1.jar:/usr/local/ebr/lib/ebr-message-v0_1_4.jar:.
This should be added to the profile (or system equivalent) of the user to save setting it each time.
-
NOTE: Ensure that the current working directory (".") is in the
CLASSPATH
. Without this any locally developed EbrServices will
fail to be found at runtime.
Copy the example configuration file to the EbrGateway user home directory. For example:
cp -rf /usr/local/ebr/g2/example_configs/gateway/config/ .
The values in this file need to be amended to reflect your EbrGateway.
See the file for detailed, commented information regarding all configurable fields.
You should now be in a position to successfully start the EbrGateway software. Change your working directory to the EbrGateway folder.
cd $HOME
Now launch the EbrGateway software with the following command:
java com.orctel.ebr.gateway.Gateway
You should now see a message stating that the CoreSoftware EbrGateway has started.
In most cases a Ctrl-c
keyboard signal will terminate the Java
process.
Advanced "background" starting and stopping procedures such as using
nohup
are platform specific and left to the EbrGateway system
administrator to implement.
Follow the same instructions below, substituting "Node" for "Gateway" where appropriate.
This section describes how to a add a new EbrService to your CoreSoftware EbrNode by guiding you through the addition and testing of an example EbrService. This procedure is typically used in cases where the LocalServices option is chosen, i.e. no EbrGateway is in operation, and you have chosen to "plug-in" your Java EbrServices directly into the NationalGatewayNode.
This can be found in the example_services
folder of the CoreSoftware
distribution. It is a simple, example EbrService that
returns the message the EbrClient sent,
but converted to upper case.
Copy UpCaseService.java
to the home directory of your EbrNode user (see CreateUser).
cp /usr/local/ebr/g2/example_services/UpCaseService.java $HOME
The directory should now look like:
ebrnode@rio:~$ ls -l total 148 drwxr-xr-x 2 ebrnode ebrnode 4096 Nov 1 14:20 config drwxr-xr-x 21 ebrnode ebrnode 4096 Nov 1 14:38 data -rw-r--r-- 1 ebrnode ebrnode 125703 Nov 1 14:38 datalayer.zip drwxr-xr-x 2 ebrnode ebrnode 4096 Nov 1 14:38 logs -rw-r--r-- 1 ebrnode ebrnode 3553 Nov 1 14:37 UpCaseService.java
We are now ready to compile the Java source into byte code.
Next, compile UpCaseService.java
.
$ javac -d . UpCaseService.java
If all goes well, you should have created UpCaseService.class
in
the $HOME/my/services
directory. Verify this by listing the
directory contents. It should resemble:
ebrnode@rio:~$ ls -l $HOME total 148 drwxr-xr-x 2 ebrnode ebrnode 4096 Nov 1 14:20 config drwxr-xr-x 21 ebrnode ebrnode 4096 Nov 1 14:38 data -rw-r--r-- 1 ebrnode ebrnode 125703 Nov 1 14:38 datalayer.zip drwxr-xr-x 2 ebrnode ebrnode 4096 Nov 1 14:38 logs drwxr-xr-x 3 ebrnode ebrnode 4096 Nov 1 14:37 my -rw-r--r-- 1 ebrnode ebrnode 3553 Nov 1 14:37 UpCaseService.java ebrnode@rio:~$ ls -l /home/ebrnode/my/services/ total 4 -rw-r--r-- 1 ebrnode ebrnode 3203 Nov 1 14:37 UpCaseService.class
We are almost ready to test the new EbrService, but
first you must add the new EbrService to the
EbrNode
configuration file, config.xml
. Add the following line to the
<ServiceList>
element.
<Service name="UpCaseService" handler="my.services.UpCaseService"/>
Your <ServiceList>
should now resemble something like:
<ServiceList> <Service name="EBR_NetworkPoll_1" handler="com.orctel.ebr.service.NetworkPollService"/> <Service name="EBR_CompanyProfile_1" handler="com.orctel.ebr.gateway.CompanyProfile"/> <Service name="EBR_StoreMessage_1" handler="com.orctel.ebr.service.StoreMessageService"/> <Service name="UpCaseService" handler="my.services.UpCaseService"/> </ServiceList>
You can now restart your Node if necessary (see EbrNodeStopping, EbrNodeStarting).
We can now test the new service using the SendMsg tool.
Start a new console session (separate from your EbrNode session -
which should still be running) with a user that has the same Java
CLASSPATH
configuration as the EbrNode user.
Copy the file upcaserequest.mime
from your EBR installation
directory to a location of your choice. For example:
$ cp /usr/local/ebr/g2/example_messages/upcaserequest.mime /tmp/
Edit the copied file upcaserequest.mime
and change the EbrMessagePartHeader
X-Ebr-Destination: GBR_LD_devldc
to be X-Ebr-Destination:
YOUR_NODE_ID
, i.e. the value should match the
ThisNode->ID
in your EbrNode
config.xml
.
Now, run the following command, substituting HOSTNAME
and
PORT
to be the real values that your EbrNode is using.
$ java com.orctel.ebr.core.SendMsg HOSTNAME PORT /tmp/upcaserequest.mime
You should see the following message correctly returned
Message-ID: <11860693.1035975336073.JavaMail.mwood@eh1> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_6_7841785.1035975336071" X-Ebr-Message-ID: MY_UNIQUE_ID X-Ebr-Part-Count: 1 X-Ebr-Total-Cost-Euro: 200 X-Ebr-Version: 2.00 X-Ebr-Time-Stamp: 01/02/2002:16:38:15 +0000 X-Ebr-Target: ebr ------=_Part_6_7841785.1035975336071 Content-Type: text/xml; name=test.xml Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=test.xml X-Ebr-Source: test X-Ebr-Destination: GBR_LD_devldc X-Ebr-User-ID: orc/1234 X-Ebr-Local-ID: orc/111ABC X-Ebr-Service: UpCaseService X-Ebr-Service-Status: 0 X-Ebr-Core-Status: 0 X-Ebr-Part-ID: MY_UNIQUE_ID/0 X-Ebr-Part-Number: 0 X-Ebr-Part-Cost-Euro: 20 X-Ebr-Session-ID: 20 X-Ebr-Log-Key: 0 X-Ebr-Delivery-Method: inline X-Ebr-Delivery-Info: <?xml version="1.0" encoding="UTF-8"?> <UpCaseReply> <message>I WISH I WAS A LITTLE BIT TALLER</message> </UpCaseReply> ------=_Part_6_7841785.1035975336071--
(Always refer to the EbrMessageHeaderTable for the latest set of EbrMessageHeaders. Examples may reference older EbrProtocol versions)
The message string is now converted to upper case.
Your EbrGateway should never be exposed directly to EbrPartners. Your NationalGatewayNode should be the access point into the system, acting as a buffer between the outside world and your EbrGateway. Therefore, your EbrGateway machine should only permit access from the IP address that your NationalGatewayNode runs on.
----- Revision r1.4 - 24 Oct 2003 - 13:22 GMT
- MartinWood
|